define(['jquery'], function($) {
    var user = undefined; //{name:'', config:{},rule:''};

    var Login = Login || (function() {
        return {
            login: function(_user) {
                user = _user;
                Login.trigger('login', user);
            },
            logout: function() {
                Login.trigger('logout');
            },
            check: function() {
                console.log('check login state');
                return user;
            }
        }
    }());

    riot.observable(Login);

    return Login;
});
